#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickView>
#include <QColor>
#include <QQmlContext>
#include <QtQuick>
#include <QDebug>
#include "sqlitedb.h"
#include "expara.h"
#include "datamodel.h"
#include "instructionpanel.h"
#include "command.h"
#include <QDebug>
static QJSValue example_qjsvalue_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
  {
      Q_UNUSED(engine)
      //Q_UNUSED(scriptEngine)

      static int seedValue = 5;
      QJSValue example = scriptEngine->newObject();
      example.setProperty("someProperty", seedValue++);
      return example;
  }
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

//    QQuickView view;
//    view.setFlags(Qt::FramelessWindowHint);
//    view.setColor(QColor(Qt::transparent));
//    view.setSource(QUrl("qrc:/main.qml"));
//    view.show();

    Command command;
    command.initMap(command.map_motion, "select Title from Instructions where Type = 'Motion&Proc.'");
    command.dealShowData("moveC * * v1000 z10 tool0");
    command.getShowData();

    qmlRegisterType<SqliteDB>("Qt.database.sqlite", 1, 0, "SqliteDB");
    qmlRegisterType<InstructionPanel>("Control.Class", 1, 0, "InstructionPanel");
    qmlRegisterType<DataModel>("Control.Class", 1, 0, "DataModel");
    qmlRegisterType<Command>("Control.Class", 1, 0, "Command");

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));



   // qmlRegisterSingletonType("Qt.database.sqlite", 1, 0, "SqliteDB", example_qjsvalue_singletontype_provider);


 //   view.rootContext()->setContextProperty("mainwindow",&view);
    return app.exec();
}
